package util;



import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;


/**
 * Created by weichyang on 2014/8/14.
 */
public class CopyImageToSdCard {


    /**
     * 复制图片到sdcard
     * @param testImageOnSdCard
     * @param KBmbm_FILE_NAME
     */
    public static void copyImageToSdCard(final File testImageOnSdCard, final String KBmbm_FILE_NAME) {

//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                try {
//                    InputStream is = AppContext.getAppContext().getAssets().open(KBmbm_FILE_NAME);
//                    FileOutputStream fos = new FileOutputStream(testImageOnSdCard);
//                    byte[] buffer = new byte[8192];
//                    int read;
//                    try {
//                        while ((read = is.read(buffer)) != -1) {
//                            fos.write(buffer, 0, read);
//                        }
//                    } finally {
//                        fos.flush();
//                        fos.close();
//                        is.close();
//                    }
//                } catch (IOException e) {
//                    L.w("Can't copy test image onto SD card");
//
//                }
//            }
//        }).start();
    }
}
